<template>
  <div>
    <h1>未绑定学生列表</h1>
    <ul>
      <li v-for="i in stulist">{{ i.name }}
        <button @click="bind(i.id)">绑定</button>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "Noshow",
  data() {
    return {
      stulist: [],
    }
  },

  methods: {
    getstulist() {
      this.axios.get('stu/').then(res => {
        this.stulist = res.data.list
      })
    },
    bind(id) {
      let tid = localStorage.getItem('tid')
      this.axios.put('stu/?id=' + id + '&tid=' + tid).then(res => {

      })
    }
  },

  mounted() {
    this.getstulist()
  }
}
</script>

<style scoped>

</style>
